frexp, frexpf[split floating-point number]

Contents|Index|Previous|Next

frexp, frexpf
[split floating-point number]

SYNOPSIS

    #include <math.h>
    double frexp(double val, int *exp);
    float frexpf(float val, int *exp);

DESCRIPTION

All non zero, normal numbers can be described as m * 2**p.

frexp represents the double val as a mantissa, m, and a power of two p. The resulting mantissa will always be greater than or equal to 0.5, and less than 1.0 (as long as val is nonzero). The power of two will be stored in *exp.

m and p are calculated so that val = m 2p.

frexpf is identical, other than taking and returning floats rather than doubles.

RETURNS

frexp returns the mantissa, m. If val is 0, infinity, or NaN, frexp will set *exp to 0 and return val.

COMPLIANCE

frexp is ANSI. frexpf is an extension.